package com.bwda.dsrs.filecenter.service.impl;

import com.bwda.dsrs.filecenter.domain.po.application.ApplicationPo;
import com.bwda.dsrs.filecenter.domain.condition.application.ApplicationCondition;
import com.bwda.dsrs.filecenter.mapper.dsrs.ApplicationMapper;
import com.bwda.dsrs.filecenter.service.ApplicationService;
import org.springframework.stereotype.Service;

/**
 * @author Administrator
 */
@Service
public class ApplicationServiceImpl extends BaseServiceImpl<ApplicationPo, ApplicationCondition, ApplicationMapper> implements ApplicationService {

    /**
     * 通过应用系统编码查询应用系统id
     * @param appCode
     * @return
     */
    @Override
    public Integer queryAppIdByAppCode(String appCode) {
        return this.getMapper().queryAppIdByAppCode(appCode);
    }

    /**
     * 查询应用系统编码名称是否唯一
     * @param appCode
     * @return 存在则返回false
     */
    @Override
    public boolean queryAppCode(String appCode) {
        boolean bExist = true;
        Integer count =  this.getMapper().queryAppCode(appCode);
        if(count>0){
            bExist = false;
        }
        return bExist;
    }
}